package com.yunti.yntk.db;

import android.content.Context;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverters;
import com.yunti.yntk.db.po.DateConverter;
import com.yunti.yntk.db.po.ExamItem;
import com.yunti.yntk.db.po.ExamStu;
import com.yunti.yntk.db.po.LocalRecord;

@Database(entities = {ExamStu.class, ExamItem.class, LocalRecord.class}, version = 1,exportSchema = false)
@TypeConverters({DateConverter.class}) // ?????????
public abstract class AppDatabase extends RoomDatabase {

    public static AppDatabase getDatabase(Context context) {
        return Room.databaseBuilder(context.getApplicationContext(),
                        AppDatabase.class, "database")
                .enableMultiInstanceInvalidation()
                .build();
    }
    public abstract ExamStuDao examStuDao();

    public abstract ExamItemDao examItemDao();

    public abstract LocalRecordDao localRecordDao();
}
